<?php
	require_once '../include/common.inc.php';
	$uid = $_SESSION['login_uid'];
	$fuser = $_SESSION['login_user'];
	if(!check_auth('rebots_msg') && !check_auth('room_admin')) {
		echo "<script>alert('没有权限');</script>";
		header("location:/user/");exit();
	}
		function rebotsuser_edit($id,$name,$fuser,$rid,$rgroup,$week,$stime,$etime){
			global $db,$tablepre;
			if(stripos(auth_group($_SESSION['login_gid']),'sys_rebots')!==false)
			{
				$db->query("update {$tablepre}rebotslist set name='$name',fuser='$fuser',rid='$rid',rgroup='$rgroup',week='$week',stime='$stime',etime='$etime' where id='$id'");
			}
		}
				
		
	if($act=="rebots_edit"){
	$week = implode(',', $week);
	rebotsuser_edit($id,$name,$fuser,$rid,$rgroup,$week,$stime,$etime);
	echo "<script>alert('添加成功');</script>";
	header("location:/user/robots.php");exit();
		}
		
$query=$db->query("select * from {$tablepre}auth_group order by id desc");
while($row=$db->fetch_row($query)){
    $group.='<option value="'.$row[id].'">GID:'.$row[id].'-'.$row[title].'</option>';
}
$queryrmid = $db->query("select rid,title from {$tablepre}config order by id asc");
while ($rowid = $db->fetch_row($queryrmid)) {
$roomid .= '<option value="' . $rowid[rid] . '">房间号:' . $rowid[rid] . '-' . $rowid[title] . '</option>';
	}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加假人</title>
<link href="style/css.css" rel="stylesheet" type="text/css" />
<script src="../script/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="laydate/laydate.js"></script>
<style>
.button {
  display: inline-block;
  *display: inline;
  /* IE7 inline-block hack */
  *zoom: 1;
  margin-bottom: 0;
  font-weight: normal;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  background-image: none;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 20px;
  padding: 4px 12px;
  font-size: 14px;
  border-radius: 4px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  color: #333333;
  background-color: #ffffff;
  border-color: #cccccc;
}
.button-success {
    color: rgb(255, 255, 255);
    background-color: rgb(92, 184, 92);
    border-color: rgb(76, 174, 76);
}

.button-danger {
    color: rgb(255, 255, 255);
    background-color: rgb(217, 83, 79);
    border-color: rgb(212, 63, 58);
}

input[type="text"], input[type="password"], textarea, select {
    display: inline-block;
    height: 20px;
    line-height: 20px;
    padding: 4px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    vertical-align: middle;
    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
    -webkit-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
    -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
    transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
}
input[type="text"], input[type="password"], input[type="email"] {
    width: 140px;
    height: 20px;
}
input, select {
    vertical-align: middle;
}
input, select, textarea, select {
    font-family: "ff-tisa-web-pro-1","ff-tisa-web-pro-2","Lucida Grande","Helvetica Neue",Helvetica,Arial,"Hiragino Sans GB","Hiragino Sans GB W3","WenQuanYi Micro Hei",sans-serif;
    line-height: 20px;
}
input, textarea, .uneditable-input {
    margin-left: 0;
}
input, button, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

input, select {
    vertical-align: middle;
}
input, select, textarea, select {
    font-family: "ff-tisa-web-pro-1","ff-tisa-web-pro-2","Lucida Grande","Helvetica Neue",Helvetica,Arial,"Hiragino Sans GB","Hiragino Sans GB W3","WenQuanYi Micro Hei",sans-serif;
    line-height: 20px;
}
select {
    height: 28px;
    height: 30px;
    -moz-box-sizing: border-box;
}
input[type="text"], input[type="password"], textarea, select {
    display: inline-block;
    height: 20px;
    line-height: 20px;
    padding: 4px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    vertical-align: middle;
    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
    -webkit-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
    -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
    transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
}
select {
    width: 166px;
    border: none;
}
select, textarea {
    width: 140px;
    border: 1px solid #ccc;
}
input, button, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}
button, select {
    text-transform: none;
}
button, input, optgroup, select, textarea {
    color: inherit;
    font: inherit;
    margin: 0;
}
user agent stylesheet
keygen, select, select[size="0"], select[size="1"] {
    border-radius: 0px;
    border-color: rgb(169, 169, 169);
}
user agent stylesheet
select:not(:-internal-list-box) {
    overflow: visible !important;
}
user agent stylesheet
select {
    -webkit-appearance: menulist;
    box-sizing: border-box;
    align-items: center;
    border-image-source: initial;
    border-image-slice: initial;
    border-image-width: initial;
    border-image-outset: initial;
    border-image-repeat: initial;
    white-space: pre;
    -webkit-rtl-ordering: logical;
    color: black;
    background-color: white;
    cursor: default;
    border-width: 1px;
    border-style: solid;
    border-color: initial;
}
user agent stylesheet
keygen, select {
    border-radius: 5px;
}
user agent stylesheet
input, textarea, keygen, select, button {
    text-rendering: auto;
    color: initial;
    letter-spacing: normal;
    word-spacing: normal;
    text-transform: none;
    text-indent: 0px;
    text-shadow: none;
    display: inline-block;
    text-align: start;
    margin: 0em 0em 0em 0em;
    font: 13.3333px Arial;
}


.table th, .table td {
    padding: 10px;
    line-height: 20px;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid #ddd;
}
breadcrumb {
    padding: 7px 14px;
    margin: 0 0 20px;
    list-style: none;
    border: 1px solid #ddd;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    -webkit-box-shadow: inset 0 1px 0 #fff;
    box-shadow: inset 0 1px 0 #fff;
}

.table-bordered th, .table-bordered td {
	border-left: 1px solid #ddd;
	border-bottom: 1px solid #ddd;
	border-right: 1px solid #ddd;
	 font-size:14px;
}

</style>
</head>
<body style="background:#ededed">
	<?php 
include_once 'head.php'; 
?>
	<div id="sidebar" class="sidebar-fixed" >
        <?php include_once 'left.php';?>
     </div>
     
     <div id="content">
     	<div class="container">
        	<div class="crumbs">
            	<a href="#">首页</a>><a href="#">修改假人</a>
          </div>
          <div class="biaoge" style="padding-left:30px; padding-right:30px;">  
            <?php echo rebotsinfo($id,'<form action="" method="post" enctype="application/x-www-form-urlencoded">
  <ul class="breadcrumb">
  <div style="border-bottom:1px dashed #CCCCCC; padding:5px; margin-bottom:5px;"><strong>修改假人</strong></div>
<table width="593" class="table table-bordered table-hover definewidth m10">
		<tr>
            <td width="114" class="tableleft" style="width:70px;">昵称：</td>
            <td width="467"><input name="name" type="text" id="name" style="width:350px;" value="{name}"/></td>
        </tr>

		  <tr>
		   <td width="114" class="tableleft">所属房间：</td>
		   <td class="table-bordered"><select style="height:30px;width:150px;" name="rid" id="rid" >
              <option value="{rid}">房间号:{rid}</option>
              ' . $roomid . '
              </select>
            </td>
		  </tr>
          <tr>
            <td width="114" class="tableleft">用 户 组：</td>
            <td><select style="height:30px; width:150px;" name="rgroup" id="rgroup" >
              <option value="{rgroup}">GID:{rgroup}</option>
              ' . $group . '
            </select>&nbsp;</td>
          </tr>
		  <tr>
            <td width="114" class="tableleft" style="width:70px;">星期：</td>
 			<td><label><input type="checkbox" name="week[]" value="1" {checked1} >一</label>
				<label><input type="checkbox" name="week[]" value="2" {checked2} >二</label>
				<label><input type="checkbox" name="week[]" value="3" {checked3} >三</label>
				<label><input type="checkbox" name="week[]" value="4" {checked4} >四</label>
				<label><input type="checkbox" name="week[]" value="5" {checked5} >五</label>
				<label><input type="checkbox" name="week[]" value="6" {checked6} >六</label>
				<label><input type="checkbox" name="week[]" value="0" {checked0} >日</label> (在线)
			</td>
          </tr>
		  <tr>
            <td width="114" class="tableleft" style="width:70px;">上线时间：</td>
            <td><input class="calendar" name="stime" type="text" id="stime" style="width:100px;" value="{stime}"/></td>
          </tr>
		  <tr style="border-bottom: 1px solid #ddd;" >
            <td width="114" class="tableleft" style="width:70px;">离线时间：</td>
            <td><input class="calendar" name="etime" type="text" id="etime" style="width:100px;" value="{etime}"/></td>
          </tr>
        </table>
 <button style=" margin-top:20px; margin-left:300px; " type="submit"  class="button button-success">确定</button>
    <input type="hidden" name="act" value="rebots_edit">
  </ul>
   
  </form>
  ') ?>
        </div>
     </div>
     <script>
laydate.render({
  elem: '#stime'
  ,type: 'time'
});
laydate.render({
  elem: '#etime'
  ,type: 'time'
});
</script>
</body>
</html>